package com.ych.composite;

import java.util.List;

/**
 * Created by 灰灰 on 2017/7/10.
 */
public class Main {

    public static void main(String[] args){
        Employer pm = new ProjectManager("项目经理");
        Employer pa = new ProjectAssistant("助理");
        Employer programmer = new Programmer("程序员");
        pm.add(pa);
        pm.add(programmer);
        List<Employer> ems = pm.getEmployers();
        for(Employer em : ems) {
            System.out.println(em.getName());
        }
    }
}
